home *** CD-ROM | disk | FTP | other *** search
/ Aminet 35 / Aminet 35 (2000)(Schatztruhe)[!][Feb 2000].iso / Aminet / gfx / misc / gnuplot-src.lha / gnuplot-3.7.1src / gnuplot-3.7.1.lha / gnuplot-3.7.1 / configure.in < prev    next >
Encoding:
Text File  |  1999-10-22  |  14.8 KB  |  498 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl configure.in for gnuplot 3.7 on Unix.
  3. dnl
  4. dnl $Id: configure.in,v 1.41.2.7 1999/10/22 18:29:24 lhecking Exp $
  5. dnl
  6. AC_INIT(graphics.c)
  7. AC_PREREQ(2.13)
  8. AC_REVISION($Revision: 1.41.2.7 $)
  9. VERSION=`sed -n 's/.*version.*"\(.*\)".*/\1/p' $srcdir/version.c|tr -d ' '`
  10. PL=`sed -n 's/.*patchlevel.*"\(.*\)".*/\1/p' $srcdir/version.c|tr -d ' '`
  11. AM_INIT_AUTOMAKE(gnuplot, $VERSION.$PL)
  12. AC_CONFIG_HEADER(config.h:config.hin)
  13.  
  14. dnl Optional features.
  15.  
  16. dnl Use builtin readline or GNU readline
  17. AC_ARG_WITH(readline,dnl
  18. [  --with-readline         use the builtin minimal readline function (default)
  19.   --without-readline      do not use the builtin readline function
  20.   --with-readline=gnu     use the GNU readline library
  21.   --with-readline=PATH            Specify the location of GNU readline],,
  22. test -z "$with_readline" && with_readline=yes
  23. )dnl
  24.  
  25. dnl If no PATH argument given, use the Unix plot library
  26. dnl Else use either GNU libplot from plotutils,
  27. dnl or ancient GNU graphics libplot
  28. AC_ARG_WITH(plot,dnl
  29. [  --with-plot             use the Unix plot library
  30.   --with-plot=PATH                Specify the location of GNU libplot],,
  31. test -z "$with_plot" && with_plot=no
  32. )dnl
  33.  
  34. dnl The gif terminal with Tom Boutell's gd library
  35. AC_ARG_WITH(gd,dnl
  36. [  --with-gd               enable gif terminal with Tom Boutell's gd library
  37.                           (requires GD library)
  38.   --with-gd=PATH                  Specify the location of libgd],,
  39. test -z "$with_gd" && with_gd=yes
  40. )dnl
  41.  
  42. dnl The Portable Network Graphics (png) terminal
  43. AC_ARG_WITH(png,dnl
  44. [  --with-png              enable png terminal
  45.                           (requires libpng and libz)
  46.   --with-png=PATH                 Specify the location of libpng],,
  47. test -z "$with_png" && with_png=yes
  48. )dnl
  49.  
  50. dnl Use .gnuplot file in current directory
  51. AC_ARG_WITH(cwdrc,dnl
  52. [  --with-cwdrc            check current directory for .gnuplot file,
  53.                           normally disabled for security reasons],,
  54. test -z "$with_cwdrc" && with_cwdrc=no
  55. )dnl
  56.  
  57. dnl Install the lasergnu printer script
  58. AC_ARG_WITH(lasergnu,dnl
  59. [  --with-lasergnu         install lasergnu printer script],
  60. if test "$withval" = yes; then LASERGNU=lasergnu_install; \
  61. else LASERGNU=lasergnu_noinstall; fi, LASERGNU=lasergnu_noinstall
  62. )dnl
  63.  
  64. dnl The Linux console driver
  65. AC_ARG_WITH(linux-vga,dnl
  66. [  --with-linux-vga        use the Linux SVGA console driver
  67.                           (requires /usr/lib/libvga)],,
  68. test -z "$with_linux_vga" && with_linux_vga=no
  69. )dnl
  70.  
  71. dnl IRIS terminal on IRIS4D series computer
  72. AC_ARG_ENABLE(iris,dnl
  73. [  --enable-iris           enable IRIS terminal (IRIS4D only)],,
  74. test -z "$enable_iris" && enable_iris=no
  75. )dnl
  76.  
  77. dnl MGR Window system
  78. AC_ARG_ENABLE(mgr,dnl
  79. [  --enable-mgr            enable MGR terminal],,
  80. test -z "$enable_mgr" && enable_mgr=no
  81. )dnl
  82.  
  83. dnl Redwood Graphics Interface Protocol
  84. AC_ARG_ENABLE(rgip,dnl
  85. [  --enable-rgip           enable Redwood Graphics Interface Protocol],,
  86. test -z "$enable_rgip" && enable_rgip=no
  87. )dnl
  88.  
  89. dnl configure.in body
  90.  
  91. dnl Compiler characteristics
  92. dnl Check for ANSI C prototypes, the const and inline keywords,
  93. dnl and ANSI style stringification
  94. AC_PROG_CC
  95. AM_C_PROTOTYPES
  96. AC_PROG_CPP
  97. AC_C_CONST
  98. AC_C_INLINE
  99. AC_C_STRINGIZE
  100.  
  101. AC_MSG_CHECKING(if compiler handles warn and error directives correctly)
  102. AC_TRY_CPP([#if 0
  103. #error "error"
  104. #warning "warning"
  105. #endif],
  106.   ERRORFIX=
  107.   AC_MSG_RESULT(yes),dnl
  108.   ERRORFIX=errorfix
  109.   AC_MSG_RESULT(no))
  110. AC_SUBST(ERRORFIX)
  111.  
  112. dnl X Window System files.
  113. AC_SUBST(X_LIBRARIES)
  114. AC_SUBST(GNUPLOT_X11)
  115. AC_PATH_XTRA
  116.  
  117. dnl Needed for LynxOS until AC_PATH_XTRA is fixed
  118. if test $ac_cv_lib_nsl_gethostbyname = no; then
  119.   AC_CHECK_LIB(bsd, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd")
  120. fi
  121.  
  122. if test "$no_x" != yes; then
  123.   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  124.   X_LIBRARIES="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
  125.   GNUPLOT_X11=gnuplot_x11
  126.   AC_DEFINE(X11, 1,
  127.             [ Define if you are using the X11 window system. ])
  128. fi
  129.  
  130.  
  131. dnl Operating systems.
  132. dnl FIXME AC_DEFINE(ISC22)
  133. dnl FIXME AC_DEFINE(KSR)
  134. dnl Check for MSDOS and djgpp, NeXT
  135. GP_MSDOS
  136. GP_NEXT
  137.  
  138. dnl Apparently, -lNeXT_s is needed on NeXT
  139. dnl _instead_ of -lm ...
  140. AC_CHECK_FUNC(sin)
  141. if test "$ac_cv_func_sin" = no ; then
  142.   AC_CHECK_LIB(m,sin)
  143. fi
  144. dnl this has to be after -lsys_s on NeXT
  145. dnlLIBS="$LIBS -lm"
  146.  
  147.  
  148. dnl Header files. ANSI first
  149. dnl We prefer that the absense of a macro is the norm, so in syscfg.h
  150. dnl configure's HAVE_XXXX defines are translated into NO_XXXX for ANSI
  151. dnl headers and functions
  152. AC_HEADER_STDC
  153.  
  154. dnl Standard headers
  155. AC_CHECK_HEADERS(errno.h float.h limits.h locale.h math.h stdlib.h string.h \
  156.   time.h sys/time.h sys/timeb.h sys/types.h)
  157. dnl other
  158. AC_CHECK_HEADERS(sys/bsdtypes.h sys/select.h sys/socket.h sys/stat.h \
  159.   sys/systeminfo.h sys/utsname.h libc.h malloc.h sgtty.h termios.h values.h)
  160. test "$ac_cv_header_sys_stat_h" = yes && AC_HEADER_STAT
  161.  
  162. dnl check if unistd actually declares anything. On NeXT 3.2 unistd is
  163. dnl conditionalized for _POSIX_SOURCE
  164. AC_MSG_CHECKING(for unistd.h)
  165. AC_EGREP_HEADER(execv, unistd.h, AC_DEFINE(HAVE_UNISTD_H) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
  166.  
  167. dnl check if errno.h header declares errno
  168. AC_MSG_CHECKING(if errno variable is declared)
  169. AC_TRY_COMPILE(
  170. [#include <stdio.h>
  171. #ifdef HAVE_ERRNO_H
  172. #include <errno.h>
  173. #endif],
  174.   errno=0,AC_MSG_RESULT(yes),dnl
  175.   AC_DEFINE(EXTERN_ERRNO, 1,
  176.             [ Define if <errno.h> declares errno. ])
  177.   AC_MSG_RESULT(no)
  178. )dnl
  179.  
  180.  
  181. dnl Types.
  182. AC_TYPE_SIZE_T
  183. AC_MSG_CHECKING(for time_t in time.h)
  184. AC_EGREP_HEADER(time_t,time.h,dnl
  185.   [ ac_cv_type_time_t=yes; AC_MSG_RESULT(yes) ],dnl
  186.   [ AC_MSG_RESULT(no) AC_CHECK_TYPE(time_t, long)])
  187. AC_TYPE_SIGNAL
  188.  
  189.  
  190. dnl Functions. Standard first, then others
  191.  
  192. dnl sunos 4 has on_exit() in place of atexit()
  193. AC_CHECK_FUNCS(atexit on_exit memcpy memmove memset bcopy bzero setvbuf \
  194.   strerror strchr index strrchr rindex strstr)
  195.  
  196. dnl gamma is called lgamma on apollos and linux
  197. dnl we prefer lgamma over gamma, see specfun.c
  198. dnl math lib is already available, see operating systems part
  199. AC_CHECK_FUNCS(erf erfc gamma lgamma getcwd pclose popen sleep snprintf \
  200.   strncasecmp strnicmp sysinfo tcgetattr)
  201. if test "$ac_cv_func_pclose" = yes && test "$ac_cv_func_popen" = yes ; then
  202.   AC_DEFINE(PIPES, 1,
  203.             [ Define if you do have the popen and pclose functions. ])
  204. fi
  205.  
  206. dnl Argument types of select()
  207. AC_FUNC_SELECT
  208.  
  209. dnl On SVR3.
  210. dnl FIXME AC_DEFINE(CRIPPLED_SELECT)
  211.  
  212. dnl check for installed linux vgalib
  213. if test "$with_linux_vga" = yes; then
  214.   AC_MSG_CHECKING(for linux vga library)
  215.   AC_CHECK_LIB(vga, vga_init,
  216.     [AC_DEFINE(LINUXVGA, 1,
  217.                [ Define if this is a Linux system with SuperVGA library. ])
  218.      LINUXSUID='chown root $(bindir)/gnuplot; chmod u+s $(bindir)/gnuplot'
  219.      TERMLIBS="$TERMLIBS -lvga"],dnl
  220.     with_linux_vga=no)
  221. fi
  222.  
  223. dnl GNU readline and the required terminal library
  224. if test "$with_readline" != no; then
  225.   if test "$with_readline" != yes; then
  226.     dnl check for terminal library
  227.     dnl this is a very cool solution from octave's configure.in
  228.     gp_tcap=""
  229.     for termlib in ncurses curses termcap terminfo termlib; do
  230.       AC_CHECK_LIB(${termlib}, tputs, [gp_tcap="$gp_tcap -l$termlib"])
  231.       case "$gp_tcap" in
  232.         *-l${termlib}*)
  233.           break
  234.         ;;
  235.       esac
  236.     done
  237.  
  238.     if test "$with_readline" = gnu; then
  239.       AC_CHECK_LIB(readline, readline,dnl
  240.        TERMLIBS="$TERMLIBS -lreadline $gp_tcap",, ${gp_tcap})
  241.     else
  242.       GP_PATH_LIB(readline,readline,[$with_readline],[${gp_tcap}])
  243.       if test "$ac_cv_lib_readline_readline" != no; then
  244.         TERMLIBS="$TERMLIBS $gp_tcap"
  245.       fi
  246.     fi
  247.  
  248.     if test "$ac_cv_lib_readline_readline" = no; then
  249.       AC_MSG_WARN([GNU readline not found - falling back to builtin readline])
  250.       with_readline=yes
  251.     else
  252.       AC_DEFINE(HAVE_LIBREADLINE, 1,
  253.                 [ Define if you are using the GNU readline library. ])
  254.     fi # ! ac_cv_lib_readline_readline = no
  255.  
  256.   fi # ! with_readline != yes
  257.  
  258.   if test "$with_readline" = yes; then
  259.     AC_DEFINE(READLINE, 1,
  260.               [ Define if you want to use the included readline function. ])
  261.   fi
  262.  
  263. fi
  264. dnl end readline
  265.  
  266. dnl libplot
  267. if test "$with_plot" != no; then
  268.   if test "$with_plot" = yes; then
  269.     dnl Unix plot library
  270.     AC_CHECK_LIB(plot,openpl,dnl
  271.      AC_DEFINE(UNIXPLOT, 1,
  272.                [ Define if you want to use the standard Unix plot library. ])
  273.      TERMLIBS="$TERMLIBS -lplot",dnl
  274.      with_plot=no)
  275.   else
  276.     dnl GNU plot library - test for new version first
  277.     TERMXLIBS="$X_LIBS -lXaw -lXmu -lXt -lXext -lX11"
  278.     GP_PATH_LIB(plot,pl_textangle,[$with_plot],[$TERMXLIBS])
  279.     if test "$ac_cv_lib_plot_pl_textangle" = no; then
  280.       GP_PATH_LIB(plot,textangle,[$with_plot],[$TERMXLIBS])
  281.       if test "$ac_cv_lib_plot_textangle" = no; then
  282.         TERMXLIBS=
  283.         GP_PATH_LIB(plot,rotate,[$with_plot])
  284.         if test "$ac_cv_lib_plot_rotate" = no; then
  285.           AC_MSG_WARN([can't find GNU libplot -- disabling gnugraph terminal])
  286.           with_plot=no
  287.         else
  288.           AC_MSG_RESULT([ - using obsolete GNU graphics library])
  289.         fi # old GNU plotlib
  290.       else
  291.         AC_MSG_RESULT([ - using GNU plotutils library])
  292.       fi # GNU plotlib pre-2.2
  293.     else
  294.       GP_PATH_HEADER(plotcompat.h,[$with_plot],dnl
  295.         AC_DEFINE(HAVE_PLOTCOMPAT_H, 1,
  296.                   [ Define if you have the <plotcompat.h> header file. ]),
  297.         AC_MSG_WARN([found GNU plotutils 2.2+ library but not plotcompat.h])
  298.         AC_MSG_WARN([please add path to plotcompat.h to CPPFLAGS in Makefile])
  299.       ) # plotcompat.h
  300.     fi # new GNU plotlib
  301.  
  302.     if test "$with_plot" != no; then
  303.       AC_DEFINE(GNUGRAPH, 1,
  304.                 [ Define if you want to use the GNU version of the Unix plot library. ])
  305.       AC_DEFINE(GNU_PLOTUTILS, 1,
  306.                 [ Define if your libplot.a is from GNU plotutils. ])
  307.     fi
  308.  
  309.   fi # ! Unix plotlib
  310. fi
  311. dnl end libplot
  312.  
  313. dnl check for Tom Boutell's gd library
  314. if test "$with_gd" != no; then
  315.   GP_PATH_LIB(gd,gdImageCreate,[$with_gd])
  316.   if test "$ac_cv_lib_gd_gdImageCreate" != no; then
  317.     GP_PATH_HEADER(gd.h,[$with_gd],dnl
  318.       dnl ACTION-IF-FOUND
  319.       AC_DEFINE(HAVE_LIBGD, 1,
  320.                 [ Define if you have Thomas Boutell's gd library. ]),dnl
  321.       dnl ACTION-IF-NOT-FOUND
  322.       AC_MSG_WARN([found gd library but not gd.h])
  323.       AC_MSG_WARN([please add path to gd.h to CPPFLAGS in Makefile]))
  324.   else
  325.     AC_MSG_RESULT([- see term/gif.trm for download details])
  326.   fi
  327. fi
  328. dnl end gd
  329.  
  330. dnl check for png and z library
  331. if test "$with_png" != no; then
  332.   GP_PATH_LIB(png,png_info_init,[$with_png],[-lz])
  333.   if test "$ac_cv_lib_png_png_info_init" != no; then
  334.     TERMLIBS="$TERMLIBS -lz"
  335.     GP_PATH_HEADER(png.h,[$with_png],,dnl
  336.      AC_MSG_WARN([found png library but not png.h])
  337.      AC_MSG_WARN([please add path to png.h to CPPFLAGS in Makefile])
  338.     )
  339.     GP_PATH_HEADER(zlib.h,[$with_png],,dnl
  340.      AC_MSG_WARN([found z library but not zlib.h])
  341.      AC_MSG_WARN([please add path to zlib.h to CPPFLAGS in Makefile])
  342.     )
  343.     if test "$ac_cv_header_png_h" != no; then
  344.       AC_EGREP_CPP([You lose], [#include "png.h"
  345. #if PNG_LIBPNG_VER < 89
  346. You lose.
  347. #endif
  348. ],dnl
  349.        AC_MSG_WARN([- libpng too old - not including png driver])
  350.        with_png=no)
  351.     else
  352.       AC_MSG_WARN([- cannot check png version - compilation may fail])
  353.     fi
  354.  
  355.   if test "$with_png" != no; then
  356.     AC_DEFINE(HAVE_LIBPNG, 1,
  357.               [ Define if you have the png library. ])
  358.   fi
  359.  
  360.   else
  361.     AC_MSG_RESULT([- see term/png.trm for download details])
  362.   fi
  363. fi
  364. dnl end png and z
  365.  
  366. dnl How do we detect the Ultrix X libraries?
  367. dnl Or is it really a server (run-time) problem?
  368. dnl FIXME AC_DEFINE(ULTRIX_KLUDGE)
  369.  
  370. dnl Removed enable options for these
  371. dnl Just autodetect
  372.  
  373. dnl SCO cgi
  374. AC_EGREP_CPP(yes,
  375. [#ifdef SCO
  376. yes
  377. #endif
  378. ],AC_CHECK_LIB(ccgi, v_opnwk,dnl
  379.     AC_DEFINE(CGI, 1,
  380.               [ Define if you want to use the CGI terminal under SCO. ])dnl
  381.               TERMLIBS="$TERMLIBS -lccgi"))
  382.  
  383. dnl Sun sunview
  384. AC_EGREP_CPP(yes,
  385. [#ifdef sun
  386. yes
  387. #endif
  388. ], AC_CHECK_LIB(suntool, window_create,dnl
  389.     AC_CHECK_HEADER(suntool/sunview.h,dnl
  390.     AC_DEFINE(SUN, 1,
  391.               [ Define if you want to use the sunview terminal (sun). ])dnl
  392.     TERMLIBS="$TERMLIBS -lsuntool -lsunwindow -lpixrect"),,dnl
  393.     [-lsunwindow -lpixrect]))
  394.  
  395. dnl Process with and enable options
  396.  
  397. if test "$with_cdwrc" = no; then
  398.   AC_DEFINE(NOCWDRC, 1,
  399.             [ Define if you do not want to read .gnuplot in the current directory. ])
  400. fi
  401.  
  402. if test "$enable_iris" = yes; then
  403.   AC_CHECK_LIB(gl_s,winopen,dnl
  404.    AC_DEFINE(IRIS, 1,
  405.              [ Define if you want to use the IRIS terminal on IRIS4D series computers. ])
  406.    TERMLIBS="$TERMLIBS -lgl_s",dnl
  407.    enable_iris=no)
  408. fi
  409.  
  410. if test "$enable_mgr" = yes; then
  411.   AC_CHECK_LIB(mgr,m_getinfo,dnl
  412.    AC_DEFINE(MGR, 1,
  413.              [ Define if you want to use the MGR Window system. ])
  414.    TERMLIBS="$TERMLIBS -lmgr -lpixrect",dnl
  415.    enable_mgr=no,[-lpixrect])
  416. fi
  417.  
  418. if test "$enable_rgip" = yes; then
  419.   AC_DEFINE(RGIP, 1,
  420.             [ Define if you want to use the Redwood Graphics Interface Protocol. ])
  421. fi
  422.  
  423. dnl Substitute variables
  424. AC_SUBST(PACKAGE)
  425. AC_SUBST(VERSION)
  426. AC_SUBST(LASERGNU)
  427. AC_SUBST(LINUXSUID)
  428. AC_SUBST(TERMLIBS)
  429. AC_SUBST(TERMXLIBS)
  430.  
  431.  
  432. dnl Report configuration
  433. eval gp_datadir=$datadir
  434. test $gp_datadir = NONE/share && gp_datadir=/usr/local/share
  435. AC_MSG_RESULT([
  436. ** Configuration summary for $PACKAGE $VERSION:
  437.  
  438.   Where is the help file?           $gp_datadir/gnuplot.gih
  439. ])
  440. test "$ac_cv_header_gd_h" = yes && \
  441.   AC_MSG_RESULT([  Enable generation of GIF files])
  442.  
  443. test "$ac_cv_header_zlib_h" = yes && \
  444.   AC_MSG_RESULT([  Enable generation of PNG files])
  445.  
  446. test "$with_cwdrc" = yes && \
  447.   AC_MSG_RESULT([  Check current directory for .gnuplot file])
  448.  
  449. if test "$with_readline" != no; then
  450.   if test "$with_readline" != yes; then
  451.     AC_MSG_RESULT([  Use GNU readline library])
  452.       test -n "$gp_tcap" && AC_MSG_RESULT([    with ${gp_tcap}])
  453.   else
  454.     AC_MSG_RESULT([  Use builtin minimal readline])
  455.   fi
  456. fi
  457.  
  458. if test "$with_plot" = yes; then
  459.   AC_MSG_RESULT([  Use the Unix plot library])
  460. elif test "$with_plot" != no; then
  461.   AC_MSG_RESULT([  Use the GNU plot library,])
  462.   if test x"$ac_cv_header_plotcompat_h" != x && \
  463.      test "$ac_cv_header_plotcompat_h" != no ; then
  464.     AC_MSG_RESULT([    version 2.2 or newer])
  465.   else
  466.     AC_MSG_RESULT([    version 2.1 or older])
  467.   fi
  468. fi
  469.  
  470. test "$with_lasergnu" = yes && \
  471.   AC_MSG_RESULT([  Install lasergnu printer script])
  472.  
  473. if test "$with_linux_vga" = yes; then
  474.   AC_MSG_RESULT([  Use the Linux SVGA console driver])
  475.   AC_MSG_RESULT([    SECURITY NOTICE: SVGAlib requires that])
  476.   AC_MSG_RESULT([    gnuplot is installed suid root!])
  477. fi
  478.  
  479. test "$enable_iris" = yes && \
  480.   AC_MSG_RESULT([  Enable IRIS terminal])
  481.  
  482. test "$enable_mgr" = yes && \
  483.   AC_MSG_RESULT([  Enable MGR terminal])
  484.  
  485. test "$enable_rgip" = yes && \
  486.   AC_MSG_RESULT([  Enable RGIP terminal])
  487.  
  488. test "$no_x" != yes && \
  489.   AC_MSG_RESULT([  Use the X Window System
  490. ])
  491. dnl end config report
  492.  
  493. dnl Write Makefiles and configuration header
  494. AC_OUTPUT([Makefile docs/Makefile docs/latextut/Makefile], \
  495. [test -z "$CONFIG_HEADERS" || echo timestamp >stamp-h])
  496.  
  497. dnl end configure.in
  498.